home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#46 (Jul 89)
/
Basic Source
/
GETRESWINDOW.S
< prev
next >
Wrap
Text File
|
1989-05-17
|
1KB
|
40 lines
'V
'S
'GETRESWINDOW function By Charles Stricklin
'Modified by Dave Kelly for MacTutor, May, 1989
'This function creates a ZBasic window from a window template
'resource. The result given is boolean;true if task is accomplished,
'false if there's a problem (i.e. resource doesn't exist, etc.)
' resourceID is the resource ID of the window template to be used.
' windowNumber is the ZBasic number of the window to be created.
' modal is boolean.
LONG FN GETRESWINDOW(ResourceID, WindowNumber, Modal)
Done=0
Title$=""
FALSE=0
MyHandle&=FN GETRESOURCE(CVI("WIND"),ResourceID)
LONG IF FN RESERROR=FALSE
MyPointer&=USR 3(MyHandle&)
Y1=PEEK WORD(MyPointer&)
X1=PEEK WORD(MyPointer&+2)
Y2=PEEK WORD(MyPointer&+4)
X2=PEEK WORD(MyPointer&+6)
Type=PEEK WORD(MyPointer&+8)+1
HasClose=PEEK WORD(MyPointer&+12)
LengthOfTitle=PEEK(MyPointer&+18)
FOR Character=1 TO LengthOfTitle
Title$=Title$+CHR$(PEEK(MyPointer&+18+Character))
NEXT
IF Type=13 THEN Type=9: 'ZBasic doesn't support ZoomNoGrow
IF HasClose=FALSE THEN Type=Type+256
IF Modal THEN Type=-Type
WINDOW WindowNumber,Title$,(X1,Y1)-(X2,Y2),Type
Done=-1
END IF
MyHandle&=USR 7(MyPointer&)
CALL DETACHRESOURCE(MyHandle&)
END FN=Done